package com.tl.app.service.impl;

import java.util.List;
import com.tl.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.tl.app.mapper.AppOrderItemMapper;
import com.tl.app.domain.AppOrderItem;
import com.tl.app.service.IAppOrderItemService;

/**
 * 子订单Service业务层处理
 * 
 * @author suhp
 * @date 2024-08-01
 */
@Service
public class AppOrderItemServiceImpl implements IAppOrderItemService 
{
    @Autowired
    private AppOrderItemMapper appOrderItemMapper;

    /**
     * 查询子订单
     * 
     * @param id 子订单主键
     * @return 子订单
     */
    @Override
    public AppOrderItem selectAppOrderItemById(Long id)
    {
        return appOrderItemMapper.selectAppOrderItemById(id);
    }

    /**
     * 查询子订单列表
     * 
     * @param appOrderItem 子订单
     * @return 子订单
     */
    @Override
    public List<AppOrderItem> selectAppOrderItemList(AppOrderItem appOrderItem)
    {
        return appOrderItemMapper.selectAppOrderItemList(appOrderItem);
    }

    /**
     * 新增子订单
     * 
     * @param appOrderItem 子订单
     * @return 结果
     */
    @Override
    public int insertAppOrderItem(AppOrderItem appOrderItem)
    {
        appOrderItem.setCreateTime(DateUtils.getNowDate());
        return appOrderItemMapper.insertAppOrderItem(appOrderItem);
    }

    /**
     * 修改子订单
     * 
     * @param appOrderItem 子订单
     * @return 结果
     */
    @Override
    public int updateAppOrderItem(AppOrderItem appOrderItem)
    {
        return appOrderItemMapper.updateAppOrderItem(appOrderItem);
    }

    /**
     * 批量删除子订单
     * 
     * @param ids 需要删除的子订单主键
     * @return 结果
     */
    @Override
    public int deleteAppOrderItemByIds(Long[] ids)
    {
        return appOrderItemMapper.deleteAppOrderItemByIds(ids);
    }

    /**
     * 删除子订单信息
     * 
     * @param id 子订单主键
     * @return 结果
     */
    @Override
    public int deleteAppOrderItemById(Long id)
    {
        return appOrderItemMapper.deleteAppOrderItemById(id);
    }
}
